<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Test</title>
    <script>
        let el = console.log;
        let dl = console.dir;

        function User() {
            name: 'dushneyan'
        }

        //给函数自身添加原型方法 构造函数不能对其进行引用
        User.__proto__.view = function () {
            return "我是User自身方法"
        }

        el(User.view())

        //只要是构造函数就能使用其方法
        User.prototype.render = function (args) {
            return args
        }

        var el2 = new User()
        el(el2.render("xiaobudai"))
        // el(el2.view())   //报错
    </script>
</head>

<body>
    <h1>Test页面</h1>
</body>

</html>